﻿<phone:PhoneApplicationPage 
    x:Class="RobotSoundDemo.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:uc="clr-namespace:RobotSoundDemo"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    shell:SystemTray.IsVisible="True">
	<phone:PhoneApplicationPage.Resources>
		<Storyboard x:Name="MoveRobot">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="ucRobot">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="244">
					<EasingDoubleKeyFrame.EasingFunction>
						<BounceEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="ucRobot">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="421">
					<EasingDoubleKeyFrame.EasingFunction>
						<BounceEase EasingMode="EaseOut"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	</phone:PhoneApplicationPage.Resources>

    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="24,24,0,12">
           
            <TextBlock x:Name="PageTitle" Text="RobotSoundDemo" Margin="-3,-8,0,0" Style="{StaticResource PhoneTextTitle1Style}" FontSize="56" />
        </StackPanel>

        <Grid x:Name="ContentGrid" Grid.Row="1">
            <uc:Robot x:Name="ucRobot" Margin="24,27,264,442" RenderTransformOrigin="0.5,0.5" >
            	<uc:Robot.RenderTransform>
            		<CompositeTransform/>
            	</uc:Robot.RenderTransform>
            </uc:Robot>
            <Button Content="Play" Height="72" HorizontalAlignment="Left" 
                    Margin="6,333,0,0" Name="btnPlay" 
                    VerticalAlignment="Top" Width="160" 
                    Click="btnPlay_Click" />
            <MediaElement x:Name="robotSound" Height="100" 
                          VerticalAlignment="Bottom" Margin="176,0,204,69" 
                          Source="sound18.wma" AutoPlay="False"/>
        </Grid>
    </Grid>
    
</phone:PhoneApplicationPage>
